//
//  BaseViewController.m
//  CurriculumFactory
//
//  Created by 张璞 on 2020/3/17.
//

#import "BaseViewController.h"
//基于QMUI
@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor whiteColor];
}
- (void)didInitialize {
    [super didInitialize];
    // 不管navigationBar的backgroundImage如何设置，都让布局撑到屏幕顶部，方便布局的统一
    self.extendedLayoutIncludesOpaqueBars = NO;
}
- (void)setupNavigationItems {
    [super setupNavigationItems];
    
    
}
//当自定义了`leftBarButtonItem`按钮之后，系统的手势返回就失效了。可以通过`forceEnableInteractivePopGestureRecognizer`来决定要不要把那个手势返回强制加回来。当 interactivePopGestureRecognizer.enabled = NO 或者当前`UINavigationController`堆栈的viewControllers小于2的时候此方法无效。
-(BOOL)forceEnableInteractivePopGestureRecognizer {
    return YES;
}
- (void)isShowNavBack_pop {
    self.navigationItem.leftBarButtonItem=[UIFactory create_Nav_itemWithTitle:@"" imageName:@"icon_back_24_black" TitleColor:nil target:self action:@selector(leftNavItemClicked)];
}
- (void)leftNavItemClicked {
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)nav_popViewController {
    [self.navigationController popViewControllerAnimated:YES];
}

- (BOOL)shouldAutorotate {
    return YES;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return self.supportedOrientationMask;
}
- (void)dealloc {
   NSString *name = NSStringFromClass([self class]);
    NSLog(@"%@ 释放了",name);
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
